<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
        echo 'this is thinkphp test cases!';
    }
    public function logTest(){
        //错误日志输出
        \Think\Log::record("xxxxxxx");
        \Think\Log::record("eeeeeeeeee");

        //业务日志输出到Elk中,具体存储数组格式，请与Elk负责人商义
         \Think\Log::record(array('f1'=>'v1','ff1'=>time()),'BUSI');
         \Think\Log::record(array('f2'=>'v2','ff2'=>time()),'BUSI');

        //业务日志直接保存到Elk中,具体存储数组格式，请与Elk负责人商义
        \Think\Log::write(array('f3'=>'v3','ff3'=>time()),'BUSI');
        \Think\Log::write(array('f4'=>'v4','ff4'=>time()),'BUSI');

        // 异常记录到日志,也会以ERR级别输出到Elk 
        throw new \Think\Exception("this is a Exception!", 1);       

        //业务日志输出

        
        echo 'hello,world! test test test test ';
    }
}